package com.zhoupu.integrated.library.model;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

@Document(collection = "books")
@Data
@Schema(description = "图书实体类")
public class Book {
    @Id
    @Schema(description = "主键ID", example = "1")
    private String id;
    @Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "基础架构")
    private String title;
    @Schema(description = "作者", requiredMode = Schema.RequiredMode.REQUIRED, example = "宙普")
    private String author;
    @Schema(description = "时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "12")
    private int yearPublished;
}
